home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / networking / applic / ntp / kent.shar / dodes.c < prev    next >
Encoding:
Text File  |  1991-09-29  |  584 b   |  21 lines

  1. main ()
  2. {
  3.   long plain [2], crypt [2], cprbuf [2];
  4.  
  5.   /* begin by reading tables and key schedule from files */
  6.   printf ("Reading filed tables and key schedule...\n");
  7.   if (1 != rdfiles ())
  8.   {
  9.     printf ("dodes -- couldn't get tables or key schedule\n");
  10.     exit (1);
  11.   }
  12.  
  13.   printf ("Enter input to encrypt as two hex longs: ");
  14.   scanf ("%lx %lx", &plain [0], &plain [1]);
  15.   des_encrypt (plain, crypt);
  16.   printf ("Encrypted result is: %lx %lx\n", crypt [0], crypt [1]);  
  17.   des_decrypt (crypt, cprbuf);
  18.   printf ("Decrypting that result: %lx %lx\n", cprbuf [0], cprbuf [1]);
  19. }
  20.  
  21.